package service.impl;

import java.sql.SQLException;
import java.util.List;

import dao.impl.AuthDaoImpl;

import entity.Auth;

import service.AuthService;

public class AuthServiceImpl implements AuthService{

	AuthDaoImpl authDao = new AuthDaoImpl();
	public List<Auth> getAuthList() throws SQLException {
		return authDao.getAuthList();
	}
	public void updateStatus(int id, int status) throws SQLException {
		authDao.updateStatus(id, status);
	}
	public Boolean judgeHasChildByParentId(int id) throws SQLException {
		return authDao.judgeHasChildByParentId(id) > 0 ? true : false;
	}
	public int deleteAuthById(int id) throws SQLException {
		return authDao.deleteAuthById(id);
	}
	public int updateMenu(int id, int is_menu) throws SQLException {
		return authDao.updateStatus(id, is_menu);
	}
	public int addAuth(Auth auth) throws SQLException {
		return authDao.addAth(auth);
	}
	public Auth getAuthById(int id) throws SQLException {
		return authDao.getAuthById(id);
	}
	public int editAuth(Auth auth) throws SQLException {
		return authDao.editAuth(auth);
	}
	public List<Auth> getMenuList() throws SQLException {
		return authDao.getMenuList();
	}

}
